<!--<div style="text-align:right;">
          <input name="" type="button" class="btn_1" value="返回" />
          <input name="" type="button" class="btn_1" value="前一个订单" />
          <input name="" type="button" class="btn_1" value="后一个订单" />
          <input name="" type="button" class="btn_1" value="打印订单" />
</div>-->
<div class="line_1"></div>

<div class="t_2">
     <div class="fl">收货人（用户）信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td width="10%" class="td1">收货人：</td>
                <td width="15%"><?=$this->order['username']?></td>
                <td width="10%" class="td1">联系电话：</td>
                <td width="15%"><?=$this->order['tel']?></td>
                <td width="10%" class="td1">地址：</td>
                <td width="15%"><?=$this->order['address']?></td>
                <td width="10%" class="td1">邮编：</td>
                <td width="15%"><?=$this->order['zip']?></td>
            </tr>
            <!--<tr>
                <td class="td1">邮编：</td>
                <td>056500</td>
                <td class="td1">地址：</td>
                <td colspan="5">河北省邯郸市磁县讲武城镇</td>
            </tr>-->
     </table>
</div>
<div class="line_1"></div>
<!-- 商品信息 -->
<div class="t_2">
     <div class="fl">订单商品详情</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table1">
            <tr>
                <th>商品名称[品牌]</th>
                <th width="100">货号</th>
                <th width="70">库存</th>
                <th width="70">购买数量</th>
                <th width="70">约定单价</th>
				<th width="70">小计</div>
            </tr>
			<?php foreach((array)$this->order_product_list as $product): ?>
            <tr>
                <td class="td2"><?=$product['product_name']?></td>
                <td><?=$product['code']?></td>
                <td><?=$product['num']?></td>
                <td><?=$product['product_num']?></td>
                <td><?=$product['product_pprice']?></td>
				<td><?=$product['product_total_pprice']?></td>
            </tr>
			<?php endforeach; ?>
            <tr>
                <td colspan="6" class="td1">总计：￥<?=$this->order['pprice']?></td>
            </tr>
     </table>
</div>

<div class="line_1"></div>


<div class="t_2">
     <div class="fl">合同信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
	 <form id="queren_hetong">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td width="10%" class="td1">合同号：</td>
                <td width="40%"><?=$this->order['contract_number']?></td>
                <td width="10%" class="td1">合同类型：</td>
                <td width="40%"><?=$this->order['contract']?></td>
            </tr>
     </table>
     <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table2">
            <tr>
                <td rowspan="3" class="td1" width="10%">付款信息：</td>
                <td class="td1" width="15%">预付款时间：</td>
                <td width="15%"><?= date('Y-m-d',$this->cpc[1]['time']); ?></td>
                <td class="td1" width="15%">预付款金额：</td>
                <td width="15%"><?=$this->cpc[1]['price']?></td>
                <td class="td1" width="15%">预付百分比：</td>
                <td width="15%"><?=$this->cpc[1]['percent']?></td>
            </tr>
            <tr>
                <td class="td1">收货后付款时间：</td>
                <td><?= date('Y-m-d',$this->cpc[2]['time']); ?></td>
                <td class="td1">收货后付款金额：</td>
                <td><?=$this->cpc[2]['price']?></td>
                <td class="td1">收货后付款百分比：</td>
                <td><?=$this->cpc[2]['percent']?></td>
            </tr>
            <tr>
                <td class="td1">尾款付款时间：</td>
                <td><?= date('Y-m-d',$this->cpc[3]['time']); ?></td>
                <td class="td1">尾款付款金额：</td>
                <td><?=$this->cpc[3]['price']?></td>
                <td class="td1">尾款付款百分比：</td>
                <td><?=$this->cpc[3]['percent']?></td>
            </tr>
			<tr>
				<td class="td1">付款银行信息</td>
				<td class="td1">付款银行</td>
				<td><?=$this->order['bank_name']?></td>
				<td class="td1">付款银行帐号</td>
				<td><?=$this->order['bank_no']?></td>
			</tr>
     </table>
	 </form>
</div>

<div class="line_1"></div>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
     <tr>
          <td width="50%" valign="top" style="padding-right:5px;">
<div class="t_2">
     <div class="fl">订单付款信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <th width="20%">执行人</th>
                <th width="20%">付款金额</th>
                <th width="20%">剩余金额</th>
                <th>操作备注</th>
                <th width="20%">操作时间</th>
            </tr>
			<?php foreach((array)$this->order_payed_history as $item): ?>
			<tr>
				<td><?=$item['username']?></td>
				<td><?=$item['payed']?></td>
				<td><?=$item['arr']?></td>
				<td><?=$item['mark']?></td>
				<td><?=date('Y-m-d H:i:s',$item['created_time'])?></td>
			</tr>
			<?php endforeach; ?>
     </table>
</div>
<div class="line_1"></div>
          </td>
          <td width="50%" valign="top" style="padding-left:5px;">
<div class="t_2">
     <div class="fl">发票信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="td1" width="20%">发票名称：</td>
                <td width="30%"><?=$this->order['fp_name']?></td>
                <td class="td1" width="20%">发票抬头：</td>
                <td width="30%"><?=$this->order['fp_tt']?></td>
            </tr>
            <tr>
                <td class="td1">发票内容：</td>
                <td colspan="3"><?=$this->order['fp_nr']?></td>
            </tr>
     </table>
</div>
<div class="line_1"></div>
          </td>
     </tr>
     <tr>
          <td valign="top" style="padding-right:5px;">
<div class="t_2">
     <div class="fl">基本信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td width="20%" class="td1">订单号：</td>
                <td width="30%"><?=$this->order['order_sn']?></td>
                <td width="20%" class="td1">订单状态：</td>
                <td width="30%"><?=orderState($this->order['audit_state'])?></td>
            </tr>
            <tr>
                <td class="td1">购货人：</td>
                <td><?=$this->order['customer_name']?></td>
                <td class="td1">下单时间：</td>
                <td><?=date('Y-m-d H:i:s',$this->order['created_time'])?></td>
            </tr>
            <tr>
                <td class="td1">配送方式：</td>
                <td>快递</td>
                <td class="td1">发货时间：</td>
                <td>未发货</td>
            </tr>
            <tr>
                <td class="td1">发货单号：</td>
                <td>-</td>
                <td class="td1">订单来源：</td>
                <td>客户前台下单</td>
            </tr>
     </table>
</div>
<div class="line_1"></div>
          </td>
          <td valign="top" style="padding-left:5px;">
<div class="t_2">
     <div class="fl">操作信息</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<?php if(!$this->operation): ?>
		<tr><td>不能执行任何操作</td></tr>
		<?php else: ?>
		<tr>
			<td class="td1" width="110">操作备注：</td>
			<td><textarea name="mark" id="mark"></textarea></td>
	    </tr>
		<?php if($this->step!='caiwu'): ?>
		<tr>
			<td class="td1" width="110">下级操作员列表：</td>
			<td><?=$this->users_html?></td>
	    </tr>
		<?php else: ?>
		<tr>
			<td class="td1" width="110">回款金额：</td>
			<td><input type="text" name="price" id="price" value="" /></td>
		</tr>
		<tr>
			<td class="td1" width="110">核对回款金额：</td>
			<td><input type="text" name="confirm_price" id="confirm_price" value="" />请在输入一次</td>
		</tr>
		<?php endif; ?>
		<tr>
			<td class="td1">操作</td>
			<td><?=$this->operation?><input rel='opt' value="作废" title="trash" class="button" type="button" style="color:red;font-weight:bold;" /></td>
		</tr>
		<?php endif; ?>
     </table>
</div>
<div class="line_1"></div>
          </td>
     </tr>
</table>

<div class="t_2">
     <div class="fl">订单操作历史记录</div>
     <div class="fr order_title">--</div>
</div>
<div class="order_show">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <th width="15%">执行人</th>
                <th width="15%">执行时间</th>
                <th width="35%">内容</th>
                <th width="35%">备注</th>
            </tr>
			<?php foreach((array)$this->order_history as $history): ?>
            <tr>
                <td><?=$history['username']?></td>
                <td><?=date('Y-m-d H:i:s',$history['timestamp'])?></td>
                <td><?=$history['desc']?></td>
                <td><?=$history['mark']?></td>
            </tr>
			<?php endforeach; ?>
     </table>
</div>
<div class="line_1"></div>

<script>
$(function(){
	$('#queren_hetong').submit(function(){
		$.post(location.href,$(this).serialize(),function(data){
			alert(data.message);
			if (data.state == 1)
			{
				window.location.reload();
			}
		},'json');
		return false;
	});
	$('#queren_price').submit(function(){
		$.post(location.href,$(this).serialize(),function(data){
			alert(data.message);
			if (data.state == 1)
			{
				window.location.reload();
			}
		},'json');
		return false;
	});
});
</script>
<script>
$(function(){
	<?php if($this->step == 'caiwu'): ?>
    $('input[title=jiakuan]').click(function(){
        $.post(location.href,{type:'jiakuan',mark:$('#mark').val(),price:$('#price').val(),confirm_price:$('#confirm_price').val()},function(data){
            alert(data.message);
            if (data.state <= 0)
            {
                return false;
            }
            else
            {
                window.location.reload();
            }
        },'json');
    });
	<?php else: ?>
    $('input[rel=opt]').click(function(){
        var curinput = $(this);
        var opt = curinput.attr('title');
        if ('trash' == opt && !confirm('确定作废该订单？')) return false;
        var next_uid = $('#next_uid').val();
        var mark = $('#mark').val();
        curinput.attr('disabled','disabled');
        $.post(location.href,{type:opt,next_uid:next_uid,mark:mark},function(data){
            alert(data.message);
            curinput.removeAttr('disabled');
            if (data.state <= 0)return false;
            window.location.reload();
        },'json');
    });
	<?php endif; ?>
});
</script>